package com.chen.controller;

import com.chen.pojo.entry.Role;
import com.chen.service.RoleService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author chen
 * @version 1.0
 * @create_date 2025/8/20
 * 角色管理
 */
@Slf4j
@RestController
@RequestMapping("/api/user-service/role")
public class RoleController {
    @Autowired
    private RoleService roleService;

    /**
     * 查询所有角色
     *
     * @return 结果
     */
    @GetMapping
    public List<Role> getAllRoles() {
        log.info("查询所有角色");
        return roleService.getAllRoles();
    }
}
